<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/head"></head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <th:block th:replace="common/header"></th:block>
    <th:block th:replace="common/nav"></th:block>

    <div class="content-wrapper">
        <section class="content-header">
            <h1>
                系统管理
                <small>字典管理</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="/index"><i class="fa fa-dashboard"></i> 首页</a></li>
                <li><a href="#">字典管理</a></li>
            </ol>
        </section>

        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title hidden-xs">字典信息列表</h3>
                            <br/>
                            <div class="box-tools">
                                <form action="list" method="get" id="searchForm">
                                    <input type="hidden" id="nowpage" name="nowpage" value="1" />

                                    <div class="input-group" style="width: 250px;">
                                        <input type="text" name="keyword" th:value="${page.keyword}" class="form-control input-sm pull-right" placeholder="字典类型">
                                        <div class="input-group-btn">
                                            <button class="btn btn-sm btn-default" type="submit"><i class="fa fa-search"></i></button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <!-- /.box-header -->
                        <div class="mailbox-controls">
                            <!-- Check all button -->
                            <a href="forward?mode=0" type="button" class="btn btn-success">新增</a>
                            <!-- <a href="/account/updateAllPassword" class="btn btn-danger" type="button">全部重置密码</a>-->
                        </div>
                        <div class="box-body">
                            <table id="example1" class="table table-bordered table-striped">
                                <thead>
                                <tr>
                                    <th>序号</th>
                                    <th>字典类型</th>
                                    <th>字典值</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <th:block th:each="e,index:${page.allentities}">
                                <tr>
                                    <td>
                                        <span th:text="${index.index+1}"></span>
                                    </td>
                                    <td>
                                        <span th:text="${e.get('name')}"></span>
                                    </td>
                                    <td>
                                        <span th:text="${e.get('value')}"></span>
                                    </td>
                                    <td>
                                        <a th:href="'forward?id=' + ${e.id} + '&mode=1'" class="btn btn-success">编辑</a>
                                        <button type="button" class="btn btn-danger" data-toggle="modal" th:data-target="'#Modal'+${e.id}">
                                            删除
                                        </button>
                                        <div class="modal fade" th:id="'Modal'+${e.id}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                                            <div class="modal-dialog" role="document">
                                                <div class="modal-content">
                                                    <div class="modal-header">
                                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                                        <h4 class="modal-title">删除操作</h4>
                                                    </div>
                                                    <div class="modal-body">
                                                        <p>你确定删除该字典信息:<span th:text=" ${e.get('value')}">  </span></p>
                                                    </div>
                                                    <div class="modal-footer">
                                                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                                        <a th:href="'delete?id='+${e.id}" type="button" class="btn btn-primary">确认</a>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                                </th:block>
                                </tbody>
                                <tfoot>
                                <tr>
                                    <th>序号</th>
                                    <th>字典类型</th>
                                    <th>字典值</th>
                                    <th>操作</th>
                                </tr>
                                </tfoot>
                            </table>
                        </div>
                        <th:block th:replace="common/page"></th:block>
                        <script type="text/javascript">
                            function jumpPage(pageno) {
                                if(pageno<1) {
                                    alert('请输入正整数');
                                } else {
                                    $('#nowpage').val(pageno);
                                    $('#searchForm').submit();
                                }
                            }
                        </script>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->
                </div>
                <!-- /.col -->
            </div>
            <!-- /.row -->
        </section>
    </div>

    <th:block th:replace="common/footer"></th:block>
</div>

<th:block th:replace="common/script"></th:block>
</body>
</html>
